home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
HAM_RAD
/
PROPAGAT
/
1004A.ZIP
/
MINIMUFX.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-05-12
|
13KB
|
338 lines
5 GOTO 140
10 REM MINIMUF.BAS VERSION 3.5
15 REM change lines 300 and 2680 for your station
20 REM SOURCE: QEX 21 NOVEMBER 1983
30 REM ADAPTATION BY JOHN E. ANDERSON, WD4MUO
40 REM ***Banner subroutine at 4000 - 4490***
45 CLS:PRINT"Please WAIT":FOR T=0 TO 8000:NEXT
50 GOSUB 4000
140 REM ***SAMPLE DRIVER FOR MINIMUF 3.5***
150 REM ***INITIAL DATA***
160 CLS:KEY OFF
170 DIM M$(37),A$(4),M(12)
180 FOR I=1 TO 12
190 READ M(I)
200 NEXT
210 DATA 31,28,31,30,31,30,31,31,30,31,30,31
220 M$="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
230 PI=3.141593
240 R0=PI/180
250 P1=2*PI
260 R1=180/PI
270 P0=PI/2
280 DEF FNACS(X)=-ATN(X/SQR(-X*X+1+1/2^50))+1.5708
290 X$=STRING$(79,61)
300 CS$="wa2tif":REM INSERT YOUR CALL SIGN
310 GOSUB 2380:REM ***TO PRINT SCREEN HEADER***
320 REM ***OPTION MENU***
330 PRINT:PRINT"PATH OPTIONS"
340 PRINT
350 PRINT 1,CS$;" to San Francisco"
360 PRINT 2,CS$;" to Rio de Janeiro"
370 PRINT 3,CS$;" to Buenos Aires"
380 PRINT 4,CS$;" to Lima, Peru"
390 PRINT 5,CS$;" to Hawaii"
400 PRINT 6,CS$;" to Japan"
410 PRINT 7,CS$;" to Sydney, Australia"
420 PRINT 8,CS$;" to Calcutta, India"
430 PRINT 9,CS$;" to Paris"
440 PRINT 10,CS$;" to Warsaw"
450 PRINT 11,CS$;" to Moscow"
460 PRINT 12,CS$;" to Tunis"
470 PRINT 13,CS$;" to Liberia"
480 PRINT 14,CS$;" to Kenya"
490 PRINT 15,CS$;" to Pretoria, U of SA"
500 PRINT 16,CS$;" to a Specified Point"
510 PRINT 17,"Between Specified Points":PRINT
520 INPUT "CHOICE? Select by path number";CH
530 IF CH<1 OR CH>17 THEN CLS:LOCATE 12,30:PRINT "BAD CHOICE NUMBER":FOR X=1 TO 5000:NEXT:CLS:GOTO 310
540 GOSUB 2380 : REM ***TO PRINT SCREEN HEADER***
550 IF CH=17 GOTO 560 ELSE 2670
560 REM ***DATA INPUTS***
570 T$="Transmitter": R$="Receiver"
580 PRINT:INPUT "Transmitter Lat, Lon (`-' for East and South)";L1,W1
590 IF L1=>-90 AND L1<=90 THEN 620
600 PRINT "INVALID Latitude. Must be in range (-90 to +90)"
610 GOTO 580
620 IF -360<=W1 AND W1<=360 THEN 650
630 PRINT "INVALID Longitude. Must be in range (-360 to +360)"
640 GOTO 580
650 PRINT:INPUT "Receiver Lat, Lon (`-' for East and South)";L2,W2
660 IF -90<=L2 AND L2<=90 THEN 690
670 PRINT "INVALID Latitude. Must be in range (-90 to +90)"
680 GOTO 650
690 IF -360<=W2 AND W2<=360 THEN 720
700 PRINT "INVALID Longitude. Must be in range (-360 to +360)"
710 GOTO 650
720 PRINT:INPUT"DATE (Day, Month),Example 15,3 ";D6,MO
730 IF 1<=MO AND MO<=12 THEN 760
740 PRINT "INVALID Month. Must be in range (1 to 12)"
750 GOTO 720
760 IF 1<=D6 AND D6<=M(MO) THEN 800
770 PRINT "INVALID Day. Must be in range (1 to";M(MO);")"
780 GOTO 720
790 REM ***SUNSPOT DATA***
800 PRINT:INPUT "STATE SOURCE OF SOLAR ACTIVITY - S = sunspot #, F = solar flux ",AN1$
810 IF AN1$="S" OR AN1$="s" THEN 880 ELSE IF AN1$="F" OR AN1$="f" THEN 820 ELSE 800
820 INPUT "SMOOTHED MEAN 10.7-cm SOLAR FLUX ";SF
830 IF SF<65 THEN PRINT"INVALID flux number. Must be greater than 65.":GOTO 820
840 IF SF>245 THEN PRINT "RESULTS MAY BE INACCURATE FOR FLUX GREATER THAN 245."
850 GOSUB 2630: REM ***TO ROUTINE FOR FLUX TO SUNSPOT NUMBER CONVERSION***
860 PRINT"A FLUX OF";SF;"EQUATES TO A SUNSPOT NUMBER OF";S9
870 GOTO 930
880 PRINT:INPUT "SMOOTHED INTERNATIONAL SUNSPOT NUMBER = ";S9
890 IF S9>=0 THEN 930
900 PRINT"INVALID sunspot number. Must be non-negative."
910 GOTO 880
920 REM ***HARDCOPY FLAG***
930 PRINT:PRINT:INPUT"Want HARDCOPY printout? Y/N ";AN$
940 IF AN$="Y" OR AN$="y" THEN LP=1 ELSE IF AN$="N" OR AN$="n" THEN LP=0 ELSE GOTO 930
950 REM ***THRESHOLD FLAG***
960 PRINT:PRINT:INPUT"Want FLAG on MUF above given frequency? Y/N ";TA$
970 IF TA$="Y" OR TA$="y" THEN TA=1 ELSE IF TA$="N" OR TA$="n" THEN TA=0 ELSE GOTO 960
980 IF TA=1 THEN INPUT"SPECIFY frequency, in MHz ";TAM
990 CLS
1000 A$=MID$(M$,3*MO-2,3)
1010 GOSUB 2380: REM ***TO PRINT SCREEN HEADER***
1020 PRINT:PRINT"DATE:";D6;A$
1030 PRINT:PRINT T$;" Location" TAB(43) R$;" Location"
1040 PRINT" LATITUDE:";L1;" LONGITUDE:";W1; TAB(43) " LATITUDE:";L2;" LONGITUDE:";W2
1050 PRINT:PRINT"SUNSPOT NUMBER = ";S9
1060 PRINT
1070 COLOR 10
1080 PRINT" MUF(MHz) UTC";
1090 FOR I=0 TO 55 STEP 5
1100 COLOR 7:LOCATE ,19+I:PRINT I;
1110 NEXT
1120 COLOR 10
1130 PRINT" ======== ===";
1140 COLOR 7
1150 LOCATE ,20:PRINT"|====|====|====|====|====|====|====|====|====|====|====|="
1160 IF LP=1 THEN GOSUB 2450 : REM ***TO PRINT HARDCOPY HEADER***
1170 L1=L1*R0
1180 W1=W1*R0
1190 L2=L2*R0
1200 W2=W2*R0
1210 FOR T5=0 TO 23
1220 GOSUB 1460 :REM ***TO MAIN CALCULATION LOOP***
1230 REM ***SCREEN AND PRINTER DATA PRINT***
1240 IF TA=0 THEN D$="*"
1250 IF TA=1 THEN IF J9=>TAM THEN D$="*" ELSE D$="."
1260 PRINT USING " ##.#";J9;:PRINT TAB(15) T5 TAB(20) "|";
1270 LOCATE ,20+CINT(J9):COLOR 10:PRINT D$ :COLOR 7
1280 IF LP=1 THEN LPRINT USING" ##.#";J9;:LPRINT TAB(15) T5 TAB(20) "|" TAB(20+CINT(J9)) D$
1290 NEXT
1300 REM ***SCREEN AND PRINTER ENDING***
1310 LOCATE ,20:PRINT"|====|====|====|====|====|====|====|====|====|====|====|="
1320 FOR I=0 TO 55 STEP 5
1330 LOCATE ,19+I:PRINT I;
1340 NEXT
1350 IF LP=1 THEN 1360 ELSE 1400
1360 LPRINT TAB(20) "|====|====|====|====|====|====|====|====|====|====|====|="
1370 FOR I=0 TO 55 STEP 5
1380 LPRINT TAB(19+I) I;
1390 NEXT
1400 FL1=0:GOSUB 3000: REM ***Calc. of Bearing and Distance***
1410 GOSUB 3200: REM ***Print Bearing and Distance***
1420 BEEP:BEEP:BEEP:BEEP:IF LP=1 THEN LPRINT CHR$(12)
1430 GOTO 3300 : REM ***Choice of continuing program***
1460 REM ***MINIMUF 3.5 CALCULATION LOOP***
1470 K7=SIN(L1)*SIN(L2)+COS(L1)*COS(L2)*COS(W2-W1)
1480 IF K7=>-1 THEN 1510
1490 K7=-1
1500 GOTO 1530
1510 IF K7<=1 THEN 1530
1520 K7=1
1530 G1=FNACS(K7)
1540 K6=1.59*G1
1550 IF K6>=1 THEN 1570
1560 K6=1
1570 K5=1/K6
1580 J9=100
1590 FOR K1=1/(2*K6) TO 1-1/(2*K6) STEP .9999-1/K6
1600 IF K5=1 THEN 1620
1610 K5=.5
1620 P=SIN(L2)
1630 Q=COS(L2)
1640 A=(SIN(L1)-P*COS(G1))/(Q*SIN(G1))
1650 B=G1*K1
1660 C=P*COS(B)+Q*SIN(B)*A
1670 D=(COS(B)-C*P)/(Q*SQR(1-C^2))
1680 IF D=>-1 THEN 1710
1690 D=-1
1700 GOTO 1730
1710 IF D<=1 THEN 1730
1720 D=1
1730 D=FNACS(D)
1740 W0=W2+SGN(SIN(W1-W2))*D
1750 IF W0=>0 THEN 1770
1760 W0=W0+P1
1770 IF W0<P1 THEN 1790
1780 W0=W0-P1
1790 IF C=>-1 THEN 1820
1800 C=-1
1810 GOTO 1840
1820 IF C<=1 THEN 1840
1830 C=1
1840 L0=P0-FNACS(C)
1850 Y1=.0172*(10+(MO-1)*30.4+D6)
1860 Y2=.409*COS(Y1)
1870 K8=3.82*W0+12+.13*(SIN(Y1)+1.2*SIN(2*Y1))
1880 K8=K8-12*(1+SGN(K8-24))*SGN(ABS(K8-24))
1890 IF COS(L0+Y2)>-.26 THEN 1980
1900 K9=0
1910 G0=0
1920 M9=2.5*G1*K5
1930 IF M9<=P0 THEN 1950
1940 M9=P0
1950 M9=SIN(M9)
1960 M9=1+2.5*M9*SQR(M9)
1970 GOTO 2230
1980 K9=(-.26+SIN(Y2)*SIN(L0))/(COS(Y2)*COS(L0)+9.999999E-04)
1990 K9=12-ATN(K9/SQR(ABS(1-K9*K9)))*7.639437
2000 T=K8-K9/2+12*(1-SGN(K8-K9/2))*SGN(ABS(K8-K9/2))
2010 T4=K8+K9/2-12*(1+SGN(K8+K9/2-24))*SGN(ABS(K8+K9/2-24))
2020 C0=ABS(COS(L0+Y2))
2030 T9=9.7*C0^9.600001
2040 IF T9>.1 THEN 2060
2050 T9=.1
2060 M9=2.5*G1*K5
2070 IF M9<=P0 THEN 2090
2080 M9=P0
2090 M9=SIN(M9)
2100 M9=1+2.5*M9*SQR(M9)
2110 IF T4<T THEN 2140
2120 IF (T5-T)*(T4-T5)>0 THEN 2150
2130 GOTO 2280
2140 IF (T5-T4)*(T-T5)>0 THEN 2280
2150 T6=T5+12*(1+SGN(T-T5))*SGN(ABS(T-T5))
2160 G9=PI*(T6-T)/K9
2170 G8=PI*T9/K9
2180 U=(T-T6)/T9
2190 G0=C0*(SIN(G9)+G8*(EXP(U)-COS(G9)))/(1+G8*G8)
2200 G7=C0*(G8*(EXP(-K9/T9)+1))*EXP((K9-24)/2)/(1+G8*G8)
2210 IF G0=>G7 THEN 2230
2220 G0=G7
2230 G2=(1+S9/250)*M9*SQR(6+58*SQR(G0))
2240 G2=G2*(1-.1*EXP((K9-24)/3))
2250 G2=G2*(1+(1-SGN(L1)*SGN(L2))*.1)
2260 G2=G2*(1-.1*(1+SGN(ABS(SIN(L0))-COS(LO))))
2270 GOTO 2340
2280 T6=T5+12*(1+SGN(T4-T5))*SGN(ABS(T4-T5))
2290 G8=PI*T9/K9
2300 U=(T4-T6)/2
2310 U1=-K9/T9
2320 G0=C0*(G8*(EXP(U1)+1))*EXP(U)/(1+G8*G8)
2330 GOTO 2230
2340 IF G2>J9 THEN 2360
2350 J9=G2
2360 NEXT K1
2370 RETURN
2380 REM ***SCREEN HEADER***
2390 CLS:COLOR 0,7
2400 PRINT X$
2410 PRINT TAB(37) "MINIMUF" STRING$(36,32)
2420 PRINT X$
2430 COLOR 7,0
2440 RETURN
2450 REM ***HEADER FOR PRINTER***
2460 LPRINT CHR$(27);"E";:
2470 LPRINT X$
2480 LPRINT TAB(37) "MINIMUF"
2490 LPRINT X$
2500 LPRINT CHR$(27);"F";
2510 LPRINT:LPRINT "DATE:";D6;A$
2520 LPRINT:LPRINT T$;" LOCATION" TAB(43) R$;" LOCATION"
2530 LPRINT " LATITUDE:";L1;" LONGITUDE:";W1; TAB(43) " LATITUDE:";L2;" LONGITUDE:";W2
2540 LPRINT:LPRINT "SUNSPOT NUMBER =";S9
2550 LPRINT
2560 LPRINT " MUF(MHz) UTC";
2570 FOR I=0 TO 55 STEP 5
2580 LPRINT TAB(19+I) I;
2590 NEXT
2600 LPRINT " ======== ===";
2610 LPRINT TAB(20) "|====|====|====|====|====|====|====|====|====|====|====|="
2620 RETURN
2630 REM ***CALCULATION OF SUNSPOT NUMBER FROM SOLAR FLUX***
2640 S9=-103.7767+1.797429*SF-(3.384356E-03)*SF^2+(4.525515E-06)*SF^3
2650 S9=INT(100*S9+.5)/100
2660 RETURN
2670 REM ***PATH OPTION LAT/LON***
2680 L1=41.9:W1=73.9:T$=CS$ : REM ***USE VALUES FOR YOUR STATION***
2690 IF CH=1 THEN L2=38:W2=122:R$="to San Francisco":GOTO 720
2700 IF CH=2 THEN L2=-23:W2=44:R$="to Rio de Janeiro":GOTO 720
2710 IF CH=3 THEN L2=-35:W2=58:R$="to Buenos Aires":GOTO 720
2720 IF CH=4 THEN L2=-12:W2=77:R$="to Lima, Peru":GOTO 720
2730 IF CH=5 THEN L2=22:W2=158:R$="to Hawaii":GOTO 720
2740 IF CH=6 THEN L2=36:W2=-140:R$="to Japan":GOTO 720
2750 IF CH=7 THEN L2=-34:W2=-151:R$="to Sydney, Australia":GOTO 720
2760 IF CH=8 THEN L2=22:W2=-88:R$="to Calcutta, India":GOTO 720
2770 IF CH=9 THEN L2=49:W2=-2:R$="to Paris":GOTO 720
2780 IF CH=10 THEN L2=52:W2=-21:R$="to Warsaw":GOTO 720
2790 IF CH=11 THEN L2=56:W2=-38:R$="to Moscow":GOTO 720
2800 IF CH=12 THEN L2=37:W2=-10:R$="to Tunis":GOTO 720
2810 IF CH=13 THEN L2=+6:W2=+8 :R$="to Liberia":GOTO 720
2820 IF CH=14 THEN L2=-2:W2=-37:R$="to Kenya":GOTO 720
2830 IF CH=15 THEN L2=-26:W2=-28:R$="to Pretoria":GOTO 720
2840 IF CH=16 THEN R$="Receiver":GOTO 650
3000 IF W1=W2 GOTO 3100 : REM ***Special geographic cases***
3010 JJ=1/TAN((W1-W2)/2)
3020 KK=(L2-L1)/2:LL=(L2+L1+1/2^50)/2
3030 PP=ATN(JJ*COS(KK)/SIN(LL)):QQ=ATN(JJ*SIN(KK)/COS(LL)):IF (L1+L2)<0 THEN PP=PP-PI
3040 XX=CINT((PP-QQ)/R0)
3050 IF XX<0 THEN 3090
3060 W$="east of true north."
3070 DIS=CINT((138/R0)*ABS(ATN(TAN(KK)*SIN(PP)/SIN(QQ+1/2^50))))
3080 RETURN
3090 W$="west of true north.":XX=-XX:GOTO 3070
3100 IF L1=L2 THEN FL1=1:GOTO 3080
3110 IF L1>L2 THEN FL1=2 ELSE FL1=3
3120 DIS=CINT((ABS(L1-L2))*138/(2*R0)):GOTO 3080
3200 IF FL1=1 THEN PRINT"Transmitter and receiver at same location."
3210 IF FL1=1 AND LP=1 THEN LPRINT"Transmitter and receiver at same location."
3220 IF FL1=2 THEN PRINT"BEARING: Due South";TAB(40) "DISTANCE: ";DIS;" miles."
3230 IF FL1=2 AND LP=1 THEN LPRINT"BEARING: Due South";TAB(40) "DISTANCE: ";DIS;" miles."
3240 IF FL1=3 THEN PRINT"BEARING: Due North";TAB(40) "DISTANCE: ";DIS;" miles."
3250 IF FL1=3 AND LP=1 THEN LPRINT"BEARING: Due North";TAB(40) "DISTANCE: ";DIS;" miles."
3260 IF FL1=0 THEN PRINT"BEARING: ";XX;" degrees ";W$:PRINT"DISTANCE: ";DIS;" miles."
3270 IF FL1=0 AND LP=1 THEN LPRINT"BEARING: ";XX;" degrees ";W$:LPRINT"DISTANCE: " ;DIS;" miles."
3280 RETURN
3300 PRINT:PRINT"Your choice: (N)ext case, Quit to (B)ASIC or (D)OS? HIT N, B, or D."
3310 NK$=INKEY$
3320 IF NK$="" GOTO 3310
3330 IF NK$="N" OR NK$="n" THEN CLS:GOTO 310
3340 IF NK$="B" OR NK$="b" THEN CLS:END
3350 IF NK$="D" OR NK$="d" THEN CLS:SYSTEM
3360 PRINT:PRINT"Try again.":PRINT:GOTO 3300
4000 REM ***Banner subroutine***
4001 SCREEN 100:COLOR 0:CLS:KEY OFF
4002 XS=6:YS=6:DIM P(640,16)
4004 LOCATE 1,1:PRINT"MUF & BEARING"
4006 P=640/XS
4008 FOR X=0 TO P:FOR Y=0 TO 15
4010 P(X,Y)=POINT(X,Y):NEXT:NEXT
4012 CLS:COLOR 15:FOR X=0 TO P:FOR Y=0 TO 15
4014 IF P(X,Y)=0 THEN C=0 ELSE C=1
4016 LINE(X*XS,Y*YS)-(X*XS+XS,Y*YS+YS),C,BF
4018 NEXT:NEXT
4020 PI=3.14159:X=1:Y=.9
4022 CIRCLE (320,800),600,1,X,PI-X:LINE(0,393)-(639,393):PAINT (320,370)
4024 CIRCLE (320,250),100,1,Y,PI-Y
4026 LINE (39,335)-(256,189)
4028 LINE (601,335)-(384,189)
4030 LINE (39,335)-(60,365):LINE (39,335)-(47,372):LINE (50,350)-(47,372):LINE (43,353)-(60,365)
4032 LINE (601,335)-(580,365):LINE(601,335)-(593,372):LINE(590,350)-(593,372):LINE(597,353)-(580,365)
4040 CIRCLE (320,800),760:CIRCLE (320,800),810
4042 LOCATE 13,8:PRINT "F LAYER": LOCATE 13,64:PRINT"IONOSPHERE"
4043 LOCATE 24,9:PRINT " KE1D ";:LOCATE 24,66:PRINT " CQ DX ";
4045 FOR N=1 TO 3
4050 FOR X=20 TO 280 STEP 20:CIRCLE (39,335),X,1,.58,.82:NEXT
4051 CIRCLE (-170,300),480,1,.25,.4:LINE (320,140)-(320,200),1:CIRCLE (-220,50),592,1,5.97,6.07
4052 FOR X=0 TO 280 STEP 20:CIRCLE (0,-50),480+X,1,5.56,5.67:NEXT
4055 FOR X=20 TO 280 STEP 20:CIRCLE (39,335),X,0,.58,.82:NEXT
4056 CIRCLE (-170,300),480,0,.25,.4:LINE (320,140)-(320,200),0:CIRCLE (-220,50),592,0,5.97,6.07
4057 FOR X=0 TO 280 STEP 20:CIRCLE (0,-50),480+X,0,5.56,5.67:NEXT
4060 NEXT
4090 RETURN
4490 RETURN